//
//  DJAutoLayoutHeadView.swift
//  dj-learn-Swift
//
//  Created by jie sun on 2022/5/22.
//  Copyright © 2022 S.J. All rights reserved.
//

import UIKit

class DJAutoLayoutHeadView: UIView {
    let topView = UIView()
    let backView = UIView()

    convenience init() {
        self.init(frame: .zero)
        
        self.topView.backgroundColor = UIColor.init(hex: 0x2B0065, alpha: 1)
        self.addSubview(self.topView)
        self.topView.snp.makeConstraints { make in
            make.left.top.right.equalTo(self)
            make.height.equalTo(120)
        }
        
        self.addSubview(self.backView)
        self.backView.backgroundColor = UIColor.white
        self.backView.snp.makeConstraints { make in
            make.top.equalTo(topView.snp.bottom).offset(-40.0)
            make.centerX.equalTo(self)
            make.width.equalTo(KScreenW - 100.0)
            make.height.equalTo(120.0)
        }
        
    }
    
}
